package com.mryang.hds.configs;

import com.mryang.hds.utils.ResultCode;

/**
 * @author Genius
 * @version 1.0.0
 * @ClassName AppException.java
 * @Description TODO 自定义的异常类
 * @createTime 2022年12月27日 15:02:00
 */

public class AppException extends RuntimeException{

    private Integer code = 500;
    private String msg = "服务器异常,请求失败！";


    public AppException(ResultCode resultCode){
        super();
        this.code = resultCode.getCode();
        this.msg = resultCode.getMessage();

    }

    public AppException(int code,String msg){
        super();
        this.code = code;
        this.msg = msg;

    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
